<?
namespace test;

/**
 * Class xj
 *
 * @package test
 */
class xj
{
    private $a;

    public function __construct()   //构造函数
    {
        $this->a = array();

    }

    public function add($val)
    {
        $this->a[] = $val;
    }

    public function display()
    {
        $b = $this->a;
        foreach ($b as $v) {
            echo $v;
        }
    }
}


$a = new xj();
$a->add(5);
$a->add(1);
$a->add(2);
$a->add(3);

$a->display();

$result='https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx313de8a191b57a13&secret=5f26ab87c7d825c907a541cc39b4fdfa';
$data=file_get_contents($result,false);
$data=json_decode($data);
var_dump($data);
?>